package test;

/**
 * Created by zenghf on 2016/6/6.
 */
public class ArrayDemo {

    public static void main(String[] args){
        int score[] ={1,3,234,21,45,11,23,41,24} ;
        int age[] = {6,4,12,56,33,12,56,324,11,2,41};
        score(score);
        print(score);
        System.out.println("-------------------");
        score(age);
        print(age);
    }

    public static void score(int temp[]){
        for(int i = 1 ; i < temp.length ; i++){
            for(int j = 0 ; j<temp.length ;j++){
                if(temp[i]<temp[j]){
                    int x = temp[i] ;
                    temp[i]=temp[j] ;
                    temp[j]=x ;
                }
            }
        }
    }

    public static void print(int[] temp){
        for(int i = 0 ; i<temp.length ; i++){
            System.out.print(temp[i]+"\t") ;
        }
    }
}
